from django.db import models
from dvadmin.utils.models import CoreModel, table_prefix, CoreModelWithoutPrimaryKey

# Create your models here.
# class defectData(CoreModelWithoutPrimaryKey):
#     dataId = models.BigAutoField(primary_key=True, help_text="Id", verbose_name="Id")
#     id = models.IntegerField( help_text="序号", verbose_name="序号",null=True)
#     defectid = models.CharField(blank=False,max_length=128,null=True)
#     productid = models.CharField(blank=False,max_length=128,null=True)
#     productname = models.CharField(blank=False,max_length=128,null=True)
#     cameraid = models.CharField(blank=False,max_length=128,null=True)
#     cameraname = models.CharField(blank=False,max_length=128,null=True)
#     batchnum = models.CharField(blank=False,max_length=128,null=True)
#     reelnum = models.CharField(blank=False,max_length=128,null=True)
#     hlength = models.CharField(blank=False,max_length=128,null=True)
#     vlength = models.CharField(blank=False,max_length=128,null=True)
#     area = models.CharField(blank=False,max_length=128,null=True)
#     speed = models.CharField(blank=False,max_length=128,null=True)
#     averagegrey = models.CharField(blank=False,max_length=128,null=True)
#     defecparamname = models.CharField(blank=False,max_length=128,null=True)
#     defecparamid = models.CharField(blank=False,max_length=128,null=True)
#     defecparamtype = models.CharField(blank=False,max_length=128,null=True)
#     defecparamconfidene = models.CharField(blank=False,max_length=128,null=True)
#     defecparamshape = models.CharField(blank=False,max_length=128,null=True)
#     date = models.CharField(blank=False,max_length=128,null=True)
#     imagepath = models.CharField(blank=False,max_length=128,null=True)
#     imagename = models.CharField(blank=False,max_length=128,null=True)
#     xaxis = models.CharField(blank=False,max_length=128,null=True)
#     yaxis = models.CharField(blank=False,max_length=128,null=True)
#     xpixel = models.CharField(blank=False,max_length=128,null=True)
#     ypixel = models.CharField(blank=False,max_length=128,null=True)
#     wpixel = models.CharField(blank=False,max_length=128,null=True)
#     hpixel = models.CharField(blank=False,max_length=128,null=True)
#     ignore = models.CharField(blank=False,max_length=128,null=True)
#     eliminate = models.CharField(blank=False,max_length=128,null=True)


#     class Meta:
#         db_table = table_prefix + "defect_data"
#         verbose_name = '检测数据表'
#         verbose_name_plural = verbose_name
#         ordering = ('-create_datetime',)

class defectDataMain(CoreModelWithoutPrimaryKey):
    dataId = models.BigAutoField(primary_key=True, help_text="Id", verbose_name="Id")
    id = models.CharField(max_length=128, help_text="序号", verbose_name="序号",null=True)
    defectid = models.CharField(blank=False,max_length=128,null=True)
    productid = models.CharField(blank=False,max_length=128,null=True)
    productname = models.CharField(blank=False,max_length=128,null=True)
    cameraid = models.CharField(blank=False,max_length=128,null=True)
    cameraname = models.CharField(blank=False,max_length=128,null=True)
    batchnum = models.CharField(blank=False,max_length=128,null=True)
    reelnum = models.CharField(blank=False,max_length=128,null=True)
    hlength = models.CharField(blank=False,max_length=128,null=True)
    vlength = models.CharField(blank=False,max_length=128,null=True)
    area = models.CharField(blank=False,max_length=128,null=True)
    speed = models.CharField(blank=False,max_length=128,null=True)
    machinecode = models.CharField(blank=False,max_length=128,null=True)
    defecparamname = models.CharField(blank=False,max_length=128,null=True)
    defecparamid = models.CharField(blank=False,max_length=128,null=True)
    defecparamtype = models.CharField(blank=False,max_length=128,null=True)
    defecparamconfidene = models.CharField(blank=False,max_length=128,null=True)
    defecparamshape = models.CharField(blank=False,max_length=128,null=True)
    date = models.CharField(blank=False,max_length=128,null=True)
    imagepath = models.CharField(blank=False,max_length=128,null=True)
    imagename = models.CharField(blank=False,max_length=128,null=True)
    xaxis = models.CharField(blank=False,max_length=128,null=True)
    yaxis = models.CharField(blank=False,max_length=128,null=True)
    xpixel = models.CharField(blank=False,max_length=128,null=True)
    ypixel = models.CharField(blank=False,max_length=128,null=True)
    wpixel = models.CharField(blank=False,max_length=128,null=True)
    hpixel = models.CharField(blank=False,max_length=128,null=True)
    ignore = models.CharField(blank=False,max_length=128,null=True)
    eliminate = models.CharField(blank=False,max_length=128,null=True)


    class Meta:
        db_table = table_prefix + "defect_data_main"
        verbose_name = '检测数据表'
        verbose_name_plural = verbose_name
        ordering = ('-create_datetime',)